/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package restaurante;

import javafx.scene.shape.*;

/**
 *
 * @author 66785403
 */
public class ShapeFactory {

    private static ShapeFactory shapeFactory = null;
    public static final double CIRCLE_RADIUS = 50;

    private ShapeFactory() {
    }

    public static ShapeFactory getInstance() {
        if (shapeFactory == null) {
            shapeFactory = new ShapeFactory();
        }
        return shapeFactory;
    }

    public Area getMesa(String tipoMesa) {
        switch (tipoMesa) {
            case "circular":
                return new Area(new Circle(CIRCLE_RADIUS));
            case "cuadrada":
                return new Area(new Rectangle(CIRCLE_RADIUS * 2, CIRCLE_RADIUS * 2));
            case "rectangular":
                return new Area(new Rectangle(CIRCLE_RADIUS, CIRCLE_RADIUS * 2));
            case "ele":
                return new AreaEle(CIRCLE_RADIUS * 2, CIRCLE_RADIUS * 2);
            default:
                throw new UnsupportedOperationException("Error nombre no valido: " + tipoMesa);
        }
    }
}
